]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
autorunManager: Provide a createBanner() implementation
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 17 Feb 2015 02:40:25 +0000 (03:40 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 20 Feb 2015 16:41:57 +0000 (17:41 +0100)
Hotplug notifications use custom notification banners to include
application icons in buttons. Bring those back by providing an
appropriate createBanner() implementation.

js/ui/components/autorunManager.js

index 59f5a048ddde3891b18590ceb8b43754e6b53218..f8b79d89a88e28d9b759b12de8de394c4b41a1ef 100644 (file)
@@ -326,15 +326,21 @@ const AutorunNotification = new Lang.Class({
         this._manager = manager;
         this._mount = source.mount;
 
-        source.apps.forEach(Lang.bind(this, function (app) {
+        // set the notification to urgent, so that it expands out
+        this.setUrgency(MessageTray.Urgency.CRITICAL);
+    },
+
+    createBanner: function() {
+        let banner = new MessageTray.NotificationBanner(this);
+
+        this.source.apps.forEach(Lang.bind(this, function (app) {
             let actor = this._buttonForApp(app);
 
             if (actor)
-                this.addButton(actor);
+                banner.addButton(actor);
         }));
 
-        // set the notification to urgent, so that it expands out
-        this.setUrgency(MessageTray.Urgency.CRITICAL);
+        return banner;
     },
 
     _buttonForApp: function(app) {
@@ -352,6 +358,7 @@ const AutorunNotification = new Lang.Class({
         let button = new St.Button({ child: box,
                                      x_fill: true,
                                      x_align: St.Align.START,
+                                     x_expand: true,
                                      button_mask: St.ButtonMask.ONE,
                                      style_class: 'hotplug-notification-item button' });